<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ page isELIgnored="true" %>
<%--引入jstl约束--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<center>
    <table border="1px" cellpadding="10px" cellspacing="0px">
        <thead><h3>用户列表：</h3></thead>
        <tr>
            <th>用户姓名</th>
            <th>用户密码</th>
            <th>用户年龄</th>
            <th>用户性别</th>
            <th>居住地址</th>
        </tr>

        <%--判断users是否有数据--%>
        <c:if test="${empty users}">
            <%--users为空--%>
            <tr>
                <th>网络繁忙，请稍后在试....</th>
            </tr>
        </c:if>

        <%--users.size() = 0--%>
        <c:if test="${users.size() == 0}">
            <tr>
                <th>暂无用户数据....</th>
            </tr>
        </c:if>
        <c:forEach items="${users}" var="user">
            <tr>
                <td>${user.username}</td>
                <td>${user.password}</td>
                <td>${user.age}</td>
                <td>${user.sex}</td>
                <td>${user.address}</td>
            </tr>
        </c:forEach>
    </table>
</center>
</body>
</html>
